import { JSBridge } from "../JSBridge";

export default class OppoUtils {

    /** 跳转到其他小游戏 */
    static navigateToOtherGame(pkgname: string, query?: any, extraData?: any): void {
        let qg = JSBridge.getQGObj();
        if (!qg) return;
        console.log('尝试跳转到小游戏: ' + pkgname);
        qg.navigateToMiniGame({
            pkgName: pkgname,
            path: '?' + query,
            extraData: {
              from: extraData
            },
            success: function() {
                console.log('跳转到小游戏( ' + pkgname + ' )成功');
            },
            fail: function(res) {
              console.log(JSON.stringify(res))
            }
          });
    }
}
